<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>小力健康</title>
    <meta name="description" content="小力健康">
    <meta name="keywords" content="小力健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="icon" href="../img/favicon.ico">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../plugins/element-ui/lib/index.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/axios-0.18.0.js"></script>
    <script type="text/javascript" src="../plugins/echarts/echarts.js"></script>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>会员管理<small>会员统计</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>会员管理</el-breadcrumb-item>
            <el-breadcrumb-item>会员统计</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
            <div id="chart1" style="height:745px;"></div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    var vue = new Vue({
        el: '#app',
    });
    // 基于准备好的dom，初始化echarts实例
    var myChart1 = echarts.init(document.getElementById('chart1'));

    // 使用刚指定的配置项和数据显示图表。
    //myChart.setOption(option);

    //ECharts 图表随浏览器大小变化自动调整大小
    window.onresize = function () {
        myChart1.resize();
    };
    /*var data = [{
        name: '预约到诊数',
        children: [{
            name: '预约数',
            value: 15,
            children: [{
                name: '今日预约数',
                value: 2
            }, {
                name: '本周预约数',
                value: 5,
            }, {
                name: '本月预约数',
                value: 4
            }]
        }, {
            name: '到诊数',
            value: 10,
            children: [{
                name: '今日到诊数',
                value: 5,
            }, {
                name: '本周到诊数',
                value: 1
            }, {
                name: '本月到诊数',
                value: 1
            }]
        }]
    }, {
        name: '会员数据',
        children: [{
            name: '新增',
            children: [{
                name: '新增会员数',
                value: 3
            }, {
                name: '本周新增会员数',
                value: 4
            }, {
                name: '本月新增会员数',
                value: 10
            }]
        },{
            name: '统计',
            children: [{
                name: '总会员数',
                value: 3
            }]
        }]
    }];



    var option = {
        title: {
            text: '会员统计',
            subtext: '',
            x: 'center'
        },
        visualMap: {
            type: 'continuous',
            min: 0,
            max: 10,
            inRange: {
                color: ['#2F93C8', '#AEC48F', '#FFDB5C', '#F98862']
            }
        },
        series: {
            type: 'sunburst',
            data: data,
            radius: [0, '90%'],
            label: {
                rotate: 'radial'
            }
        }
    };


    myChart1.setOption(option);*/
    axios.get("/report/getMemberStatistics.do").then((res) => {
        myChart1.setOption(
            {
                title: {
                    text: '会员统计',
                    subtext: '',
                    x: 'center'
                },
                visualMap: {
                    type: 'continuous',
                    min: 0,
                    max: 10,
                    inRange: {
                        color: ['#2F93C8', '#AEC48F', '#FFDB5C', '#F98862']
                    }
                },
                series: {
                    type: 'sunburst',
                    data: res.data.data,
                    radius: [0, '85%'],
                    label: {
                        rotate: 'radial'
                    }
                }
            });
    });
</script>
</html>
